package com.example.administrator.yunniuusedcar.adapter;

import android.content.Context;
import android.content.Intent;

import com.example.administrator.yunniuusedcar.R;
import com.example.administrator.yunniuusedcar.activity.CommodityDetailsActivity;
import com.example.administrator.yunniuusedcar.activity.DetailsCarActivity;
import com.example.administrator.yunniuusedcar.model.mode_benn.ZgEquatorCar_ZongHe_Bean;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.List;

/** 适配器，中规豪车 综合  (存在 有不稳定的bug)
 * Created by USER2015 on 2017/12/23.
 */

public class ZhongGuiCar_zongHeAdapter extends CommonAdapter<ZgEquatorCar_ZongHe_Bean>{

    public ZhongGuiCar_zongHeAdapter(Context context, int layoutId, List<ZgEquatorCar_ZongHe_Bean> datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder holder, ZgEquatorCar_ZongHe_Bean zgEquatorCar_zongHe_bean, int position) {
//        holder.setText(R.id.iv_home_carPage,zgEquatorCar_zongHe_bean.data.get(position).logo);

//        Picasso.with(holder.itemView.getContext()).load(zgEquatorCar_zongHe_bean.data.get(position).logo).into((ImageView) holder.getView(R.id.iv_infomationPage));
        holder.setText(R.id.tv_home_catInfo,zgEquatorCar_zongHe_bean.data.get(position).name);
        holder.setText(R.id.tv_ZG_carYhMoney,"优惠价格："+zgEquatorCar_zongHe_bean.data.get(position).integral_range +"万");
        holder.setText(R.id.tv_home_carPay,"付款："+zgEquatorCar_zongHe_bean.data.get(position).sale);
        holder.setText(R.id.tv_home_carPay,"收藏："+ zgEquatorCar_zongHe_bean.data.get(position).collection_num);
        holder.setText(R.id.tv_home_carMoney,"市场价："+zgEquatorCar_zongHe_bean.data.get(position).market_price);

        Intent intent = new Intent(mContext,CommodityDetailsActivity.class);
        intent.putExtra("RanCarid",zgEquatorCar_zongHe_bean.data.get(position).car_id);
        mContext.startActivity(intent);


    }

    @Override
    public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
        super.setOnItemClickListener(onItemClickListener);

    }

}
